import { Component } from 'react'
import { View, Text, Swiper, SwiperItem } from '@tarojs/components'
import './index.scss'

export default class Index extends Component {


  componentWillMount() {
  }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }

  render() {
    const clickHandler = (e) => {
      e.stopPropagation() // 阻止冒泡
    }
    return (
      <View className='index'>
        <Swiper
          className='box'
          autoplay
          interval={3000}
          indicatorColor='#999'
          onClick={clickHandler}
          onAnimationFinish={() => { }}
        >
          <SwiperItem data-idx={1}>
            <View className='text'>1</View>
          </SwiperItem>
          <SwiperItem data-idx={2}>
            <View className='text'>2</View>
          </SwiperItem>
          <SwiperItem data-idx={3}>
            <View className='text'>3</View>
          </SwiperItem>
        </Swiper>
        <Text>{process.env.TARO_ENV}</Text>
      </View>
    )
  }
}
